#!/usr/bin/env bash
#构建镜像
docker build -t zhanjixun/dubbo-demo-nginx:latest ./nginx
docker build -t zhanjixun/dubbo-demo-mysql:latest ./mysql
docker build -t zhanjixun/dubbo-demo-biz:latest ./dubbo-demo-biz
docker build -t zhanjixun/dubbo-demo-web:latest ./dubbo-demo-web

docker tag zhanjixun/dubbo-demo-nginx:latest docker-registry:5000/zhanjixun/dubbo-demo-nginx:latest
docker tag zhanjixun/dubbo-demo-mysql:latest docker-registry:5000/zhanjixun/dubbo-demo-mysql:latest
docker tag zhanjixun/dubbo-demo-biz:latest docker-registry:5000/zhanjixun/dubbo-demo-biz:latest
docker tag zhanjixun/dubbo-demo-web:latest docker-registry:5000/zhanjixun/dubbo-demo-web:latest

docker push docker-registry:5000/zhanjixun/dubbo-demo-nginx:latest
docker push docker-registry:5000/zhanjixun/dubbo-demo-mysql:latest
docker push docker-registry:5000/zhanjixun/dubbo-demo-biz:latest
docker push docker-registry:5000/zhanjixun/dubbo-demo-web:latest
#部署堆栈
docker stack deploy -c docker-compose.yml dubbo-demo

